Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix textures not exporting after loading a world that uses obj models #874

Merged
merged 9 commits into from
Jul 2, 2021
Merged

Fix textures not exporting after loading a world that uses obj models #874

merged 9 commits into from
Jul 2, 2021

Conversation

ddengster
Copy link
Contributor

@ddengster ddengster commented Jun 22, 2021

🦟 Bug fix

Summary

When exporting via the collada world export plugin, if the world was made using obj models the textures will not export.
The fix is a simple conditional change from if (_matIndex < 0) to if (newMatIndex < 0). The prior condition ensures that the block of code on line 124 will never execute given the circumstances, which is certainly a bug.

I've also added a test that checks the existance of the textures exported. You can run the new test ./build/ignition-gazebo5/bin/INTEGRATION_collada_world_exporter from your ignition workspace.

Related: #802

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

Signed-off-by: ddengster <ed.fan@osrfoundation.org>
Signed-off-by: ddengster <ed.fan@osrfoundation.org>
@github-actions github-actions bot added the 🏢 edifice Ignition Edifice label Jun 22, 2021
@ddengster ddengster marked this pull request as ready for review June 22, 2021 06:55
Signed-off-by: ddengster <ed.fan@osrfoundation.org>
TEST_F(ColladaWorldExporterFixture, ExportWorldMadeFromObj)
{
ignition::common::setenv("IGN_GAZEBO_RESOURCE_PATH",
(std::string(PROJECT_SOURCE_PATH) + "/test/worlds:" +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use ignition::common::JoinPaths here and below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed a475ee4

test/integration/collada_world_exporter.cc Show resolved Hide resolved
ddengster and others added 3 commits June 23, 2021 14:16
Signed-off-by: ddengster <ed.fan@osrfoundation.org>

Update test/integration/collada_world_exporter.cc

Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Signed-off-by: ddengster <ed.fan@osrfoundation.org>
Signed-off-by: ddengster <ed.fan@osrfoundation.org>
@ddengster
Copy link
Contributor Author

ddengster commented Jun 29, 2021

@chapulina Looks like the tests failing are unrelated to this PR. Are there any other blockers for this PR?

@ahcorde ahcorde merged commit 9fa9e36 into gazebosim:ign-gazebo5 Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏢 edifice Ignition Edifice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants